package com.xiuxian.mapper;

import com.xiuxian.model.Comment;
import com.xiuxian.model.dto.CommentDTO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CommentMapper {


    @Select("select  *   from  jdbc_comment ")
    List<Comment> findAll();

    @Select("select  *   from  jdbc_comment  where   id  = #{id}")
    Comment  getByid(Integer id);

    @Insert("insert  into  jdbc_comment(id,video_id,content,comment_id,user_id) values(#{id},#{videoId},#{content},#{commentId},#{userId})")
    Integer   save(Comment comment);

    CommentDTO  findWithUser(Integer id);

    CommentDTO  findByid(Integer id);
}
